package data;

import java.io.File;
import java.sql.SQLException;
import java.util.ArrayList;

import database.DataDAO;
import database.Database;

public class Image {
	private String fileURL;
	private int imageID, projectID;
	ArrayList<Record> records;
	
	public Image(){
		
	}
	
	public Image(int in_imageID, int in_projectID, String in_fileURL) {
		imageID = in_imageID;
		projectID = in_projectID;
		fileURL = in_fileURL;
	}

	public void loadImage(Database db) throws SQLException{
		DataDAO dao = db.getDataDAO();
		
		records = dao.getAllRecords(imageID);
		
		for(Record rv : records){
			rv.loadRecord(db);
		}
	}
	
	public void setFileURL(String file) {
		this.fileURL = file;
	}

	public void setImageID(int imageID) {
		this.imageID = imageID;
	}

	public void setProjectID(int projectID) {
		this.projectID = projectID;
	}

	public String getFileURL() {
		return fileURL;
	}

	public int getImageID() {
		return imageID;
	}

	public int getProjectID() {
		return projectID;
	}
}
